package blog.juejin.socket.client;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * author : yeswater
 * date : 2024/8/8
 */

public class BlockClient {
    public static void main(String[] args) {
        try {
            Socket socket = new Socket("localhost", 6301);
            OutputStream outputStream = socket.getOutputStream();
            Scanner scanner = new Scanner(System.in);
            while (true) {
                outputStream.write(scanner.nextLine().getBytes());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
